home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 8
/
Aminet 8 (1995)(GTI - Schatztruhe)[!][Oct 1995].iso
/
Aminet
/
text
/
hyper
/
gmake.lha
/
gmake
/
c_source
/
debug.c
next >
Wrap
C/C++ Source or Header
|
1995-08-22
|
715b
|
51 lines
// Debug stuff
#include "standard.h"
FILE * db;
char err_out[] = "KCON:////DEBUG";
static BOOL debug;
initialise_debug(BOOL debug_arg)
{
debug = debug_arg;
if(!debug)
return;
if((db=fopen(err_out,"w")) == NULL)
{
fprintf(stderr,"ERROR Debug option failed."
" Do you have KCON installed?");
debug=FALSE;
return;
}
REM("Debug On");
}
close_debug()
{
if(debug)
fclose(db);
}
dbug(char * msg, int line,char * file)
{
static int i = 1;
char text[256];
if(!debug)
return;
fprintf(db,"DEBUG %3d\t%s\n",i,msg);
fprintf(db,"\tLine: %d \tFile: %s\n\n%",line,file);
fflush(db);i++;
}
dwait()
{
if(!debug)
return;
REM("** pause: press return **");
getchar();
}